import { $axios } from '@/utils/http';

// 登录
export async function login(params?: RecordItem) {
  return $axios.request({ url: 'http://localhost:8090/dyh/user/getLogin', method: 'GET', params });
}

// 修改个人信息
export async function updBuy(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/user/updBuy',
    method: 'POST',
    params,
  });
}

// 修改商家信息
export async function updShop(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/user/updShop',
    method: 'POST',
    params,
  });
}

// 解除禁言
export async function endBan(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/user/endBan',
    method: 'GET',
    params,
  });
}
// 通过id查找用户
export async function selectById(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/user/selectById',
    method: 'GET',
    params,
  });
}

// 通过角色查找用户
export async function getAllUser(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/user/getAllUser',
    method: 'GET',
    params,
  });
}

// 注册
export async function registerUer(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/user/registerUer',
    method: 'POST',
    params,
  });
}

// 管理员数据浏览页人员统计的数量
export async function getCount(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/user/getCount',
    method: 'POST',
    params,
  });
}

// 上传图片
export async function uploadImageUser(params?: RecordItem) {
  return $axios.request({
    url: 'http://localhost:8090/dyh/user/uploadImageUser',
    method: 'POST',
    params,
    isFormData: true,
  });
}
